package com.dson.provider.service;

import com.dson.api.StudentService;
import com.dson.api.TeacherService;
import org.apache.dubbo.config.annotation.DubboService;

@DubboService
public class TeacherServiceImpl implements TeacherService {

    @Override
    public void methodA() {
        int random = (int) (Math.random()* 100);
        try {
            // 随机休眠0-100毫秒
            Thread.currentThread().sleep(random);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("This is methodA..."+random+"ms");
    }

    @Override
    public void methodB() {
        int random = (int) (Math.random()* 100);
        try {
            // 随机休眠0-100毫秒
            Thread.currentThread().sleep(random);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("This is methodB..."+random+"ms");
    }

    @Override
    public void methodC() {
        int random = (int) (Math.random()* 100);
        try {
            // 随机休眠0-100毫秒
            Thread.currentThread().sleep(random);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("This is methodC..."+random+"ms");
    }
}
